// vue.config.js 配置说明
// 这里只列一部分，具体配置惨考文档啊
const webpack = require('webpack')
const path = require('path');
function resolve(dir) {
  return path.join(__dirname, dir)
}
//默认启动8527 可以通过 npm run dev --port=端口号  来进行端口更换
const port = process.env.port || process.env.npm_config_port || 8081 // dev port
module.exports = { 
    publicPath:'./',
    lintOnSave: false,
    productionSourceMap: false,//为false的话会减少打包时间,并且避免F12看到源码
    devServer: {
        port: port, // 端口号
        host: 'localhost',
        https: false, // https:{type:Boolean}
        open: 'Google Chrome', //配置自动启动浏览器
        hot: true
    },
	configureWebpack: {
	    plugins: [
	      new webpack.ProvidePlugin({
	        $:"jquery",
	        jQuery:"jquery",
	        "windows.jQuery":"jquery"
	      })
	    ]
	},
    chainWebpack:(config) => {
        config.resolve.alias.set('@public',resolve('./public')),
		config.plugin('html').tap(args => {
		  args[0].title = '明海物流';
		  return args;
		})
    },
    pwa:{
        iconPaths: {
          favicon32: 'favicon.ico',
          favicon16: 'favicon.ico',
          appleTouchIcon: 'favicon.ico',
          maskIcon: 'favicon.ico',
          msTileImage: 'favicon.ico'
        }
    }
}
